<template>
	<view class="">
		<u-toast ref="uToast" />
		<u-navbar :is-back="navigate" title="文件管理" back-icon-color='#333333' height="50" :border-bottom="false">
			<view class=""
				style=" display: flex;align-content: center; margin-left:25rpx; color:#333333; font-size: 30rpx;"
				v-show="label" @click.stop="select_all">
				{{check}}
			</view>
			<view class="" style="margin-left: 560rpx; display: flex;align-content: center;" v-show="!label">
				<image src="../../static/tupian95.png" mode="widthFix" style="width: 30rpx;"></image>
				<image src="../../static/tupian96.png" mode="widthFix" style="width: 30rpx;margin-left: 20rpx;"
					@click="$toLink('../upload_files/upload_files',{})"></image>
			</view>
			<view class=""
				style=" display: flex;align-content: center; margin-left:570rpx; color:#2f96fe; font-size: 30rpx;"
				v-show="label" @click="handleClick">
				{{complete}}
			</view>
		</u-navbar>
		<u-select v-model="pop_show" mode="single-column" :list="selectPeople" @confirm="confirm"></u-select>
		<u-select v-model="pop_class" mode="single-column" :list="chooseClass" @confirm="confirmClass"></u-select>
		<u-mask :show="display">
			<view class="warp">
				<view class="rect" @tap.stop>
					<view class="tanchu">
						是否取消共享?
					</view>
					<view class="anniu">
						<view class="" @click="display=false">
							取消
						</view>
						<view class="" @click="ensure">
							确定
						</view>
					</view>
				</view>
			</view>
		</u-mask>
		<u-mask :show="delect_select">
			<view class="warp">
				<view class="rect" @tap.stop>
					<view class="tanchu">
						确认删除勾选的文件?
					</view>
					<view class="anniu">
						<view class="" @click="delect_select=false">
							取消
						</view>
						<view class="" @click="delete_file">
							确定
						</view>
					</view>
				</view>
			</view>
		</u-mask>
		<u-mask :show="active">
			<view class="sendWarp">
				<view class="rect" @tap.stop>
					<view class="examine">
						<text>查看全部老师</text>
						<image src="../../static/tupian149.png" mode="widthFix" @click="active=false"></image>
					</view>
					<view class="all_teachers">
						{{allTeacher}}
					</view>
				</view>
			</view>
		</u-mask>
		<u-select v-model="teacher" mode="mutil-column-auto" :list="teacher_list" @confirm="handle_sure"></u-select>
		<u-mask :show="share_teacher">
			<view class="teacherWarp">
				<view class="rect" @tap.stop>
					<view class="examine">
						<text>查看</text>
						<image src="../../static/tupian149.png" mode="widthFix" @click="share_teacher=false"></image>
					</view>
					<view class="file_name">
						<text>文件名:</text>
						<text>{{send_teacher_file}}</text>
					</view>
					<view class="file_type">
						<text>类型:</text>
						<text>{{send_teacher_type}}</text>
					</view>
					<view class="file_size">
						<text>大小:</text>
						<text>{{send_teacher_size}}</text>
					</view>
					<view class="note">
						<text>备注:</text>
					</view>
					<textarea value="" class="area" placeholder="单行输入" />
					<view class="select_location">
						<text class="location_title">选择老师</text>
						<view class="file_location">
							<text style="overflow:hidden;">{{collect_teacher?collect_teacher.join(','):''}}</text>
							<text @click="teacher=true"></text>
						</view>
					</view>
					<view class="anniu">
						<view class="" @click="share_teacher=false">
							取消
						</view>
						<view class="" @click.stop="shareFile">
							确定
						</view>

					</view>
				</view>
			</view>
		</u-mask>
		<u-mask :show="send_parent">
			<view class="familyWarp">
				<view class="rect" @tap.stop>
					<view class="examine">
						<text>查看</text>
						<image src="../../static/tupian149.png" mode="widthFix" @click="send_parent=false"></image>
					</view>
					<view class="note">
						<text>备注:</text>
					</view>
					<textarea value="" class="area" v-model="share_form.remark" placeholder="单行输入" />
					<!-- 	<view class="select_class">
						<text class="class_title">选择学期</text>
						<view class="select_grade">
							<text style="color:#ccc;">{{selectGradeName}}</text>
							<text @click="pop_show=true"></text>
						</view>
						<view class="select_classes">
							<text style="color:#ccc;">{{selectClassName}}</text>
							<text @click="select_clbum"></text>
						</view>
					</view> -->
					<view class="select_class">
						<text class="class_title">选择班级</text>
						<view class="select_grade">
							<text style="color:#ccc;">{{selectGradeName}}</text>
							<text @click="pop_show=true"></text>
						</view>
						<view class="select_classes">
							<text style="color:#ccc;">{{selectClassName}}</text>
							<text @click="select_clbum"></text>
						</view>
					</view>
					<view class="anniu" style="margin-top:160rpx;">
						<view class="" @click="send_parent=false">
							取消
						</view>
						<view class="" @click="shareToParent">
							确定
						</view>

					</view>
				</view>
			</view>
		</u-mask>
		<u-tabs name="cate_name" bar-width="96" font-size="26rpx" count="cate_count" :list="list" :is-scroll="true"
			height="65" active-color="#2C7CFE" inactive-color="#999999" bg-color="#fff" :current="current"
			@change="change"></u-tabs>
		<view class="" style="width: 100%; height: 1rpx;border-bottom: 1rpx solid #F2F2F2;">
		</view>
		<view class="management">
			<view class="left" @click="send_file">
				<image src="../../static/tupian89.png" mode="widthFix"> </image>
				<text :style="{color:left_color}">{{parent_folder}}</text>
			</view>
			<view class="right" @click="manage_file">
				<image src="../../static/tupian97.png" mode="widthFix"> </image>
				<text :style="{color:right_color}">{{management_file}}</text>
			</view>
		</view>
		<view class="education">
			<view class="per_file" v-for="(item,index) in fileLists" :key="index" @click="longPress(index)">
				<image :src="$picture(item.file_type)" mode="widthFix" class="left"></image>
				<view class="center">
					<view class="">
						{{item.name}}
					</view>
					<view class="">
						<text style="width:450rpx;">{{item.create_time}}</text>
						<text>{{item.file_info?item.file_info.size:''}}</text>
					</view>
				</view>
				<view class="right">
					<view class="" @click.stop="navigte_details(item)">
						{{item.share_user?item.share_user.join(',').substr(0,7)+'...':''}}
					</view>
					<view class="" @click.stop="pop(item)">
						<image src="../../static/tupian150.png" mode="widthFix" v-show="item.share_user"></image>
						<text>{{item.share_user?'取消共享':''}}</text>
					</view>
				</view>
				<view class="delete" v-show="label">
					<image :src="item.file_boolen?'../../static/tupian113.png':'../../static/tupian112.png'"
						mode="widthFix" @click.stop="toggle(index)"></image>
				</view>
			</view>
		</view>
		<view class="bottom_select" v-show="label">
			<view class="icon" v-for="(i,j) in bottom_list">
				<view class="picture">
					<image :src="i.url" mode="widthFix" @click="handle_click(j)"></image>
				</view>
				<text>{{i.text}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '../../request.js'
	export default {
		data() {
			return {
				list: [{
						name: '个人文件',
					},
					{
						name: '年级文件',
					},
					{
						name: '班级文件',
					},
					{
						name: '共享给我',
					},
					{
						name: '我的共享',
					},
					{
						name: '专业化',
					},
					{
						name: '发展档案',
					},
					{
						name: '学校文件'
					},
				],
				divide_list: [],
				complete: '完成',
				select_teacher_id: [],
				allTeacher: '',
				share_teacher: false,
				navigate: true,
				delect_select: false,
				send_parent: false,

				share_form: {
					net_disk_id: '',
					year_id: "",
					grade_id: '',
					semester_id: "",
					classes_id: '',
					remark: '',
				},
				check: '全选',
				pop_class: false,
				bottom_list: [{
						url: '../../static/tupian19.png',
						text: '发送给家长',
					},
					{
						url: '../../static/tupian31.png',
						text: '共享',
					},
					{
						url: '../../static/tupian43.png',
						text: '删除',
					}
				],
				num: '',
				display: false,
				active: false,
				label: false,
				current: 0,
				current_file: 0,
				student_list: [],
				parent_folder: '发送给家长文件',
				management_file: '分班管理文件',
				left_color: '',
				right_color: '',
				file_lists: [],
				my_lists: [],
				share_lists: [],
				disk_id: '',
				pop_show: false,
				selectClassName: '选择班级',
				selectGradeName: '选择年级',
				select_people: [],
				choose_class: [],
				record_list: [],
				send_teacher_file: "",
				send_teacher_type: '',
				send_teacher_size: '',
				teacher_list: [],
				collect_teacher: [],
				teacher: false,
				teacher_form: {
					net_disk_id: '',
					user_ids: "",
				},
				give_family: '',
			}
		},
		onLoad() {
			this.myFileLists(1);
			this.gradeLists();
			this.groupLists();
		},
		computed: {
			fileLists() {
				switch (this.current_file) {
					case 3:
						if (this.share_lists) {
							this.share_lists.forEach(item => {
								this.$set(item, 'file_boolen', false);
							})
							return this.share_lists;
						} else {
							return [];
						}
						break;
					case 4:
						if (this.my_lists) {
							this.my_lists.forEach(item => {
								this.$set(item, 'file_boolen', false);
							})
							return this.my_lists;
						} else {
							return [];
						}
						break;
					case 9:
						if (this.divide_list) {
							this.divide_list.forEach(item => {
								this.$set(item, 'file_boolen', false);
							})
							return this.divide_list;
						} else {
							return [];
						}
						break;
					default:
						if (this.file_lists) {
							this.file_lists.forEach(item => {
								this.$set(item, 'file_boolen', false);
							})
							return this.file_lists;
						} else {
							return [];
						}
				}

			},
			selectPeople() {
				if (this.select_people) {
					return this.select_people;
				} else {
					return [];
				}
			},

			chooseClass() {
				if (this.choose_class) {
					return this.choose_class;
				} else {
					return [];
				}
			}

		},
		methods: {
			confirm(e) {
				console.log(e);
				this.selectGradeName = e[0].label;
				if (this.give_family == 1) {
					this.share_form.grade_id = e[0].value;
				}
				for (let i = 0; i < this.student_list.length; i++) {
					if (e[0].value == this.student_list[i].value) {
						this.choose_class = this.student_list[i].children;
						this.record_list.push(this.student_list[i].value);
					}

				}
			},
			navigte_details(param) {
				if (param.share_user) {
					this.active = true;
					this.allTeacher = param.share_user.join(',');
				}
			},
			handle_click(param) {
				let arr = [];
				switch (this.current_file) {
					case 3:
						this.share_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.value);
							}
						})
						break;
					case 4:
						this.my_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.value);
							}
						})
						break;
					case 9:
						this.divide_list.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.value);
							}
						})
						break;
					default:
						this.file_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.value);
							}
						})
				}
				console.log(arr);
				switch (param) {
					case 0:
						if (arr.length > 0) {
							this.send_parent = true;
							this.give_family = 1;
						} else {
							this.$refs.uToast.show({
								title: '请先勾选文件!',
								type: 'warning',
							})
						}

						break;
					case 1:
						if (arr.length > 0) {
							if (arr.length >= 2) {
								this.$refs.uToast.show({
									title: '请选择一个文件!',
									type: 'warning',
								})
							} else {
								this.share_teacher = true;
								switch (this.current_file) {
									case 3:
										this.share_lists.forEach(item => {
											if (item.file_boolen) {
												this.send_teacher_file = item.name;
												this.send_teacher_type = item.file_type;
												this.send_teacher_size = '';
												this.teacher_form.net_disk_id = item.net_disk_id;

											}
										})
										break;
									case 4:
										this.my_lists.forEach(item => {
											if (item.file_boolen) {
												this.send_teacher_file = item.name;
												this.send_teacher_type = item.file_type;
												this.send_teacher_size = '';
												this.teacher_form.net_disk_id = item.net_disk_id;
											}
										})
										break;
									case 9:
										this.divide_list.forEach(item => {
											if (item.file_boolen) {
												this.send_teacher_file = item.name;
												this.send_teacher_type = item.file_type;
												this.send_teacher_size = '';
												this.teacher_form.net_disk_id = item.net_disk_id;
											}
										})
										break;
									default:
										this.file_lists.forEach(item => {
											if (item.file_boolen) {
												this.send_teacher_file = item.name;
												this.send_teacher_type = item.file_type;
												this.send_teacher_size = '';
												this.teacher_form.net_disk_id = item.net_disk_id;
											}
										})
								}

							}
						} else {
							this.$refs.uToast.show({
								title: '请先勾选文件!',
								type: 'warning',
							})
						}
						break;
					case 2:
						if (arr.length > 0) {
							this.delect_select = true;
						} else {
							this.$refs.uToast.show({
								title: '请先勾选文件!',
								type: 'warning',
							})
						}
						break;

				}
			},
			handle_sure(e) {
				console.log(e);
				this.collect_teacher.push(e[1].label);
				this.select_teacher_id.push(e[1].value);
			},
			//删除文件
			delete_file() {
				let arr = [];
				let str = '';
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				switch (this.current_file) {
					case 3:
						this.share_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.net_disk_id);
							}
						})
						break;
					case 4:
						this.my_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.net_disk_id);
							}
						})
						break;
					case 9:
						this.divide_list.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.net_disk_id);
							}
						})
						break;
					default:
						this.file_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.net_disk_id);
							}
						})
				}

				console.log(arr);
				str = arr ? arr.join(',') : '';
				request({
					url: base_url + 'teacher/net_disk/deleteFile',
					method: 'post',
					data: {
						net_disk_ids: str,
					},
					success(res) {
						if (res.statusCode == 200) {
							_this.delect_select = false;
							switch (_this.current_file) {
								case 0:
									_this.myFileLists(1);
									break;
								case 1:
									_this.myFileLists(2);
									break;
								case 2:
									_this.myFileLists(3);
									break;
								case 3:
									_this.shareToMe();
									break;
								case 4:
									_this.myShareLists();
									break;
								case 5:
									_this.myFileLists(4);
									break;
								case 6:
									_this.myFileLists(5);
									break;
								case 7:
									_this.myFileLists(6);
									break;
								case 8:
									_this.myFileLists(8);
									break;
								case 9:
									_this.myShareToParent();
									break;
							}
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			//获取老师的列表
			groupLists() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				request({
					url: base_url + 'office/group/lists',
					data: {
						school_district_id: uni.getStorageSync('school_district_id')
					},
					method: 'post',
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data.data);
							res.data.data.data.forEach((item, index) => {
								_this.teacher_list.push({
									label: item.name,
									value: item.subject_id,
									children: []
								})
								_this.userLists(item.subject_id, index);
							})

						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			userLists(param1, param2) {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				request({
					url: base_url + 'office/group_user/lists',
					data: {
						subject_id: param1
					},
					method: 'post',
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data.data);
							res.data.data.data.forEach(item => {
								_this.teacher_list[param2].children.push({
									label: item.teacher_info ? item.teacher_info.full_name : '',
									value: item.teacher_user_id,
								})
							})

						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			//分班管理文件
			myShareToParent() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				request({
					url: base_url + 'teacher/net_disk/myShareToParent',
					method: 'post',
					data: {
						classes_id: 0,
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data.data);
							_this.divide_list = res.data.data.data;
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			select_clbum() {
				console.log(this.choose_class, this.record_list);
				if (this.record_list.length == 0) {
					this.$refs.uToast.show({
						title: '请先选择年级!',
						type: 'warning',
					})
				} else {
					this.pop_class = true;
				}
			},
			toggle(param) {

				switch (this.current_file) {
					case 3:
						this.share_lists[param].file_boolen = !this.share_lists[param].file_boolen;
						break;
					case 4:
						this.my_lists[param].file_boolen = !this.my_lists[param].file_boolen;
						break;
					case 9:
						this.divide_list[param].file_boolen = !this.divide_list[param].file_boolen;
						break;
					default:
						this.file_lists[param].file_boolen = !this.file_lists[param].file_boolen;
				}
			},
			select_all() {
				switch (this.current_file) {
					case 3:
						this.share_lists.forEach(item => {
							item.file_boolen = true;
						})
						break;
					case 4:
						this.my_lists.forEach(item => {
							item.file_boolen = true;
						})
						break;
					case 9:
						this.divide_list.forEach(item => {
							item.file_boolen = true;
						})
						break;
					default:
						this.file_lists.forEach(item => {
							item.file_boolen = true;
						})
				}
			},
			pop(param) {
				this.disk_id = param.net_disk_id + '';
				if (param.share_user) {
					this.display = true;
				}
			},
			confirmClass(e) {
				console.log(e);
				this.selectClassName = e[0].label;
				if (this.give_family == 1) {
					this.share_form.classes_id = e[0].value;
				}

			},
			gradeLists() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				request({
					url: base_url + 'teacher/classes/gradeLists',
					method: 'post',
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							res.data.data.forEach((item, index) => {
								_this.student_list.push({
									label: item.name,
									value: item.grade_id,
									children: [],
								})
								_this.select_people.push({
									label: item.name,
									value: item.grade_id,
								})
								_this.classesLists(item.grade_id, index);

							})
							console.log(_this.student_list);
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			shareToParent() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let share_arr = [];
				let arr = [];
				let str = '';
				let _this = this;
				switch (this.current_file) {
					case 3:
						this.share_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.net_disk_id);
							}
						})
						break;
					case 4:
						this.my_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.net_disk_id);
							}
						})
						break;
					case 9:
						this.divide_list.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.net_disk_id);
							}
						})
						break;
					default:
						this.file_lists.forEach(item => {
							if (item.file_boolen) {
								arr.push(item.net_disk_id);
							}
						})
				}

				console.log(arr);
				if (arr.length > 1) {
					share_arr = arr.splice(0, 1);
					console.log(share_arr);
					str = share_arr.join(',');
				} else {
					str = arr.join(',');
				}
				this.share_form.net_disk_id = str;
				request({
					url: base_url + 'teacher/net_disk/shareToParent',
					method: 'post',
					data: {
						...this.share_form,
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							_this.send_parent = false;
							switch (_this.current_file) {
								case 0:
									_this.myFileLists(1);
									break;
								case 1:
									_this.myFileLists(2);
									break;
								case 2:
									_this.myFileLists(3);
									break;
								case 3:
									_this.shareToMe();
									break;
								case 4:
									_this.myShareLists();
									break;
								case 5:
									_this.myFileLists(4);
									break;
								case 6:
									_this.myFileLists(5);
									break;
								case 7:
									_this.myFileLists(6);
									break;
								case 8:
									_this.myFileLists(8);
									break;
								case 9:
									_this.myShareToParent();
									break;
							}
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			shareFile() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				if (this.select_teacher_id) {
					this.teacher_form.user_ids = this.select_teacher_id.join(',');
				} else {
					this.teacher_form.user_ids = '';
				}
				request({
					url: base_url + 'teacher/net_disk/shareFile',
					method: 'post',
					data: {
						...this.teacher_form,
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							_this.share_teacher = false;
							switch (_this.current_file) {
								case 0:
									_this.myFileLists(1);
									break;
								case 1:
									_this.myFileLists(2);
									break;
								case 2:
									_this.myFileLists(3);
									break;
								case 3:
									_this.shareToMe();
									break;
								case 4:
									_this.myShareLists();
									break;
								case 5:
									_this.myFileLists(4);
									break;
								case 6:
									_this.myFileLists(5);
									break;
								case 7:
									_this.myFileLists(6);
									break;
								case 8:
									_this.myFileLists(8);
									break;
								case 9:
									_this.myShareToParent();
									break;
							}

						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			classesLists(param, param2) {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let grade_id = param;
				let indexes = param2;
				let _this = this;
				request({
					url: base_url + 'teacher/classes/classesLists',
					method: 'post',
					data: {
						grade_id: grade_id
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							res.data.data.forEach((item, index) => {
								_this.student_list[param2].children.push({
									label: item.classes_name,
									value: item.classes_id,
								})
							})
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			longPress(param) {
				console.log('触发了吗')
				this.navigate = false;
				this.label = true;
				switch (this.current_file) {
					case 3:
						this.share_lists[param].file_boolen = !this.share_lists[param].file_boolen;
						break;
					case 4:
						this.my_lists[param].file_boolen = !this.my_lists[param].file_boolen;
						break;
					case 9:
						this.divide_list[param].file_boolen = !this.divide_list[param].file_boolen;
						break;
					default:
						this.file_lists[param].file_boolen = !this.file_lists[param].file_boolen;
				}
			},
			handleClick() {
				this.navigate = true;
				this.label = false;
			},
			change(index) {
				console.log(index);
				this.current = index;
				this.current_file = index;
				this.left_color = '#333333';
				this.right_color = '#333333';
				switch (this.current_file) {
					case 0:
						this.myFileLists(1);
						break;
					case 1:
						this.myFileLists(2);
						break;
					case 2:
						this.myFileLists(3);
						break;
					case 3:
						this.shareToMe();
						break;
					case 4:
						this.myShareLists();
						break;
					case 5:
						this.myFileLists(4);
						break;
					case 6:
						this.myFileLists(5);
						break;
					case 7:
						this.myFileLists(6);
						break;
				}
			},
			send_file() {
				// this.current ='';
				this.left_color = '#2C7CFE';
				this.right_color = '#333333';
				this.current_file = 8;
				this.myFileLists(8);
			},
			manage_file() {
				// this.current = 0;
				this.current_file = 9;
				this.myShareToParent();
				this.left_color = '#333333';
				this.right_color = '#2C7CFE';
			},
			ensure() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				this.dispay = false;
				request({
					url: base_url + 'teacher/net_disk/cancelShareFile',
					method: 'post',
					data: {
						net_disk_id: this.disk_id
					},
					success(res) {
						if (res.statusCode == 200) {
							switch (_this.current_file) {
								case 0:
									_this.myFileLists(1);
									break;
								case 1:
									_this.myFileLists(2);
									break;
								case 2:
									_this.myFileLists(3);
									break;
								case 3:
									_this.shareToMe();
									break;
								case 4:
									_this.myShareLists();
									break;
								case 5:
									_this.myFileLists(4);
									break;
								case 6:
									_this.myFileLists(5);
									break;
								case 7:
									_this.myFileLists(6);
									break;
								case 8:
									_this.myFileLists(8);
									break;
								case 9:
									_this.myShareToParent();
									break;
							}
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			shareToMe() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				this.share_lists = [];
				request({
					url: base_url + 'general/net_disk/shareToMe',
					method: 'post',
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data.data);
							_this.share_lists = res.data.data.data;
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			myShareLists() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				this.my_lists = [];
				request({
					url: base_url + 'general/net_disk/myShareLists',
					method: 'post',
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data.data);
							_this.my_lists = res.data.data.data;
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			myFileLists(param) {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				this.file_lists = [];
				request({
					url: base_url + 'teacher/net_disk/myFileLists',
					method: 'post',
					data: {
						parent_id: '0',
						disk_type: param,
						keyword: '',
						file_type: -1
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data.data);
							_this.file_lists = res.data.data.data;
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.management {
		width: 100%;
		height: 76rpx;
		display: flex;
		justify-content: flex-start;
		align-items: center;

		.left {
			width: 250rpx;
			display: flex;
			margin-left: 80rpx;
			justify-content: flex-start;
			align-items: center;

			image {
				&:nth-child(1) {
					width: 35rpx;
				}
			}

			text {
				&:nth-child(2) {
					color: #333333;
					margin-left: 30rpx;
					font-size: 26rpx;
				}
			}
		}

		.right {
			width: 250rpx;
			margin-left: 80rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;

			image {
				&:nth-child(1) {
					width: 35rpx;
				}
			}

			text {
				&:nth-child(2) {
					color: #333333;
					margin-left: 30rpx;
					font-size: 26rpx;
				}
			}
		}
	}

	.warp {
		display: flex;
		align-items: flex-start;
		justify-content: center;
		height: 100%;

		.rect {
			margin-top: 450rpx;
			border-radius: 10rpx;
			width: 480rpx;
			height: 250rpx;
			background-color: #fff;

			.tanchu {
				width: 100%;
				height: 150rpx;
				font-size: 33rpx;
				color: #3E3E3E;
				text-align: center;
				line-height: 150rpx;
			}

			.anniu {
				width: 100%;
				height: 100rpx;
				display: flex;
				justify-content: space-around;
				align-items: center;

				view {
					border-radius: 30rpx;
					width: 150rpx;
					height: 60rpx;
					text-align: center;
					line-height: 60rpx;
					font-size: 26rpx;

					&:nth-child(1) {
						color: #2C78FE;
						margin-left: 15rpx;
						border: 1px solid #2C78FE;
						background: #fff;

					}

					&:nth-child(2) {
						color: #fff;
						margin-right: 15rpx;
						background: linear-gradient(to right, #2C78FE, #32B0FF);
					}


				}
			}
		}
	}

	.sendWarp {
		display: flex;
		align-items: flex-start;
		justify-content: center;
		height: 100%;

		.rect {
			margin-top: 400rpx;
			border-radius: 10rpx;
			width: 480rpx;
			height: 370rpx;
			background-color: #fff;

			.examine {
				width: 100%;
				height: 62rpx;
				background: #F5F8F9;
				display: flex;
				justify-content: flex-start;
				border-radius: 10rpx;
				align-items: center;

				text {
					&:nth-child(1) {
						width: 170rpx;
						height: 62rpx;
						line-height: 62rpx;
						text-align: center;
						color: #666666;
						font-size: 26rpx;
						margin-left: 155rpx;
					}
				}

				image {
					&:nth-child(2) {
						width: 35rpx;
						margin-left: 100rpx;
					}
				}
			}

			.all_teachers {
				width: 440rpx;
				margin-left: 20rpx;
				font-size: 24rpx;
				color: #333333;
				height: 200rpx;
				overflow: hidden;
				margin-top: 50rpx;
			}
		}
	}

	.teacherWarp {
		display: flex;
		align-items: flex-start;
		justify-content: center;
		height: 100%;

		.rect {
			margin-top: 200rpx;
			border-radius: 10rpx;
			width: 668rpx;
			height: 704rpx;
			background-color: #fff;

			.examine {
				width: 100%;
				height: 62rpx;
				background: #F5F8F9;
				display: flex;
				justify-content: flex-start;
				border-radius: 10rpx;
				align-items: center;

				text {
					&:nth-child(1) {
						width: 60rpx;
						height: 62rpx;
						line-height: 62rpx;
						text-align: center;
						color: #666666;
						font-size: 26rpx;
						margin-left: 304rpx;
					}
				}

				image {
					&:nth-child(2) {
						width: 35rpx;
						margin-left: 230rpx;
					}
				}
			}

			.file_name {
				width: 100%;
				height: 55rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						width: 105rpx;
						font-size: 24rpx;
						color: #666666;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}

					&:nth-child(2) {
						width: 470rpx;
						margin-left: 20rpx;
						font-size: 24rpx;
						color: #333333;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}
				}

			}

			.file_type {
				width: 100%;
				height: 55rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						width: 105rpx;
						font-size: 24rpx;
						color: #666666;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}

					&:nth-child(2) {
						width: 470rpx;
						margin-left: 20rpx;
						font-size: 24rpx;
						color: #333333;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}
				}
			}

			.file_size {
				width: 100%;
				height: 55rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						width: 105rpx;
						font-size: 24rpx;
						color: #666666;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}

					&:nth-child(2) {
						width: 470rpx;
						margin-left: 20rpx;
						font-size: 24rpx;
						color: #333333;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}
				}
			}

			.note {
				width: 100%;
				height: 55rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						width: 105rpx;
						font-size: 24rpx;
						color: #666666;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}
				}
			}

			.area {
				width: 618rpx;
				height: 118rpx;
				border-radius: 8rpx;
				border: 1rpx solid #F2F2F2;
				margin-left: 25rpx;
				margin-top: 15rpx;
				text-indent: 1em;
				font-size: 26rpx;
				color: #999999;
			}

			.select_class {
				width: 100%;
				height: 62rpx;
				margin-top: 15rpx;
				display: flex;
				justify-content: flex-start;
				align-items: center;

				.class_title {
					width: 180rpx;
					text-indent: 1em;
					font-size: 24rpx;
					color: #666666;

				}

				.select_grade {
					width: 226rpx;
					height: 60rpx;
					display: flex;
					align-items: center;
					justify-content: flex-start;
					border: 1rpx solid #F2F2F2;
					border-radius: 5rpx;
					line-height: 60rpx;

					text {
						&:nth-child(1) {
							font-size: 24rpx;
							color: #666666;
							width: 190rpx;
							text-indent: 1em;
						}

						&:nth-child(2) {
							width: 0rpx;
							margin-top: 20rpx;
							height: 0rpx;
							margin-left: 0rpx;
							border-width: 14rpx 14rpx 14rpx 14rpx;
							border-color: #ccc transparent transparent transparent;
							border-style: solid;
						}
					}
				}

				.select_classes {
					width: 226rpx;
					height: 60rpx;
					display: flex;
					margin-left: 20rpx;
					align-items: center;
					justify-content: flex-start;
					border: 1rpx solid #F2F2F2;
					border-radius: 5rpx;
					line-height: 60rpx;

					text {
						&:nth-child(1) {
							font-size: 24rpx;
							color: #666666;
							width: 190rpx;
							text-indent: 1em;
						}

						&:nth-child(2) {
							width: 0rpx;
							margin-top: 20rpx;
							height: 0rpx;
							margin-left: 0rpx;
							border-width: 14rpx 14rpx 14rpx 14rpx;
							border-color: #ccc transparent transparent transparent;
							border-style: solid;
						}
					}
				}


			}

			.select_location {
				width: 100%;
				height: 62rpx;
				margin-top: 15rpx;
				display: flex;
				justify-content: flex-start;
				align-items: center;

				.location_title {
					width: 180rpx;
					text-indent: 1em;
					font-size: 24rpx;
					color: #666666;

				}

				.file_location {
					width: 472rpx;
					height: 60rpx;
					display: flex;
					align-items: center;
					justify-content: flex-start;
					border: 1rpx solid #F2F2F2;
					border-radius: 5rpx;
					line-height: 60rpx;

					text {
						&:nth-child(1) {
							font-size: 24rpx;
							color: #333333;
							width: 416rpx;
							text-indent: 1em;
						}

						&:nth-child(2) {
							width: 0rpx;
							margin-top: 20rpx;
							height: 0rpx;
							margin-left: 20rpx;
							border-width: 14rpx 14rpx 14rpx 14rpx;
							border-color: #ccc transparent transparent transparent;
							border-style: solid;
						}
					}
				}
			}

			.anniu {
				width: 100%;
				height: 70rpx;
				margin-top: 40rpx;
				display: flex;
				justify-content: space-around;
				align-items: center;

				view {
					border-radius: 30rpx;
					width: 150rpx;
					height: 60rpx;
					text-align: center;
					line-height: 60rpx;
					font-size: 26rpx;

					&:nth-child(1) {
						color: #2C78FE;
						margin-left: 15rpx;
						border: 1px solid #2C78FE;
						background: #fff;

					}

					&:nth-child(2) {
						color: #fff;
						margin-right: 15rpx;
						background: linear-gradient(to right, #2C78FE, #32B0FF);
					}


				}
			}
		}
	}

	.familyWarp {
		display: flex;
		align-items: flex-start;
		justify-content: center;
		height: 100%;

		.rect {
			margin-top: 200rpx;
			border-radius: 10rpx;
			width: 668rpx;
			height: 704rpx;
			background-color: #fff;

			.examine {
				width: 100%;
				height: 62rpx;
				background: #F5F8F9;
				display: flex;
				justify-content: flex-start;
				border-radius: 10rpx;
				align-items: center;

				text {
					&:nth-child(1) {
						width: 60rpx;
						height: 62rpx;
						line-height: 62rpx;
						text-align: center;
						color: #666666;
						font-size: 26rpx;
						margin-left: 304rpx;
					}
				}

				image {
					&:nth-child(2) {
						width: 35rpx;
						margin-left: 230rpx;
					}
				}
			}

			.file_name {
				width: 100%;
				height: 55rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						width: 105rpx;
						font-size: 24rpx;
						color: #666666;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}

					&:nth-child(2) {
						width: 470rpx;
						margin-left: 20rpx;
						font-size: 24rpx;
						color: #333333;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}
				}

			}

			.file_type {
				width: 100%;
				height: 55rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						width: 105rpx;
						font-size: 24rpx;
						color: #666666;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}

					&:nth-child(2) {
						width: 470rpx;
						margin-left: 20rpx;
						font-size: 24rpx;
						color: #333333;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}
				}
			}

			.file_size {
				width: 100%;
				height: 55rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						width: 105rpx;
						font-size: 24rpx;
						color: #666666;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}

					&:nth-child(2) {
						width: 470rpx;
						margin-left: 20rpx;
						font-size: 24rpx;
						color: #333333;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}
				}
			}

			.note {
				width: 100%;
				height: 55rpx;
				display: flex;
				justify-content: flex-start;

				text {
					&:nth-child(1) {
						width: 105rpx;
						font-size: 24rpx;
						color: #666666;
						text-indent: 1em;
						height: 24rpx;
						margin-top: 29rpx;
					}
				}
			}

			.area {
				width: 618rpx;
				height: 118rpx;
				border-radius: 8rpx;
				border: 1rpx solid #F2F2F2;
				margin-left: 25rpx;
				margin-top: 15rpx;
				text-indent: 1em;
				font-size: 26rpx;
				color: #999999;
			}

			.select_class {
				width: 100%;
				height: 62rpx;
				margin-top: 15rpx;
				display: flex;
				justify-content: flex-start;
				align-items: center;

				.class_title {
					width: 180rpx;
					text-indent: 1em;
					font-size: 24rpx;
					color: #666666;

				}

				.select_grade {
					width: 226rpx;
					height: 60rpx;
					display: flex;
					align-items: center;
					justify-content: flex-start;
					border: 1rpx solid #F2F2F2;
					border-radius: 5rpx;
					line-height: 60rpx;

					text {
						&:nth-child(1) {
							font-size: 24rpx;
							color: #666666;
							width: 190rpx;
							text-indent: 1em;
						}

						&:nth-child(2) {
							width: 0rpx;
							margin-top: 20rpx;
							height: 0rpx;
							margin-left: 0rpx;
							border-width: 14rpx 14rpx 14rpx 14rpx;
							border-color: #ccc transparent transparent transparent;
							border-style: solid;
						}
					}
				}

				.select_classes {
					width: 226rpx;
					height: 60rpx;
					display: flex;
					margin-left: 20rpx;
					align-items: center;
					justify-content: flex-start;
					border: 1rpx solid #F2F2F2;
					border-radius: 5rpx;
					line-height: 60rpx;

					text {
						&:nth-child(1) {
							font-size: 24rpx;
							color: #666666;
							width: 190rpx;
							text-indent: 1em;
						}

						&:nth-child(2) {
							width: 0rpx;
							margin-top: 20rpx;
							height: 0rpx;
							margin-left: 0rpx;
							border-width: 14rpx 14rpx 14rpx 14rpx;
							border-color: #ccc transparent transparent transparent;
							border-style: solid;
						}
					}
				}


			}

			.select_location {
				width: 100%;
				height: 62rpx;
				margin-top: 15rpx;
				display: flex;
				justify-content: flex-start;
				align-items: center;

				.location_title {
					width: 180rpx;
					text-indent: 1em;
					font-size: 24rpx;
					color: #666666;

				}

				.file_location {
					width: 472rpx;
					height: 60rpx;
					display: flex;
					align-items: center;
					justify-content: flex-start;
					border: 1rpx solid #F2F2F2;
					border-radius: 5rpx;
					line-height: 60rpx;

					text {
						&:nth-child(1) {
							font-size: 24rpx;
							color: #333333;
							width: 190rpx;
							text-indent: 1em;
						}

						&:nth-child(2) {
							width: 0rpx;
							margin-top: 20rpx;
							height: 0rpx;
							margin-left: 246rpx;
							border-width: 14rpx 14rpx 14rpx 14rpx;
							border-color: #ccc transparent transparent transparent;
							border-style: solid;
						}
					}
				}
			}

			.anniu {
				width: 100%;
				height: 70rpx;
				margin-top: 40rpx;
				display: flex;
				justify-content: space-around;
				align-items: center;

				view {
					border-radius: 30rpx;
					width: 150rpx;
					height: 60rpx;
					text-align: center;
					line-height: 60rpx;
					font-size: 26rpx;

					&:nth-child(1) {
						color: #2C78FE;
						margin-left: 15rpx;
						border: 1px solid #2C78FE;
						background: #fff;

					}

					&:nth-child(2) {
						color: #fff;
						margin-right: 15rpx;
						background: linear-gradient(to right, #2C78FE, #32B0FF);
					}


				}
			}
		}
	}

	.education {
		width: 710rpx;
		margin-left: 20rpx;

		.per_file {
			width: 100%;
			border-bottom: 1rpx solid #F2F2F2;
			height: 126rpx;
			display: flex;
			justify-content: flex-start;

			.left {
				width: 43rpx;
				margin-top: 29rpx;
				margin-left: 10rpx;
			}

			.center {
				width: 350rpx;
				margin-left: 26rpx;
				margin-top: 29rpx;
				height: 80rpx;


				view {
					&:nth-child(1) {
						width: 100%;
						color: #333333;
						font-size: 28rpx;
					}

					&:nth-child(2) {
						margin-top: 8rpx;
						width: 100%;
						display: flex;
						justify-content: flex-start;
						align-items: center;

						text {
							color: #999999;
							font-size: 20rpx;

							&:nth-child(1) {
								width: 280rpx;
							}
						}

					}
				}

			}

			.right {
				width: 190rpx;
				margin-left: 75rpx;
				margin-top: 29rpx;
				height: 80rpx;

				view {
					&:nth-child(1) {
						width: 100%;
						color: #333333;
						text-indent: 1em;
						font-size: 24rpx;
						height: 45rpx;
					}

					&:nth-child(2) {
						// margin-top: 21rpx;
						width: 100%;
						color: #b9b9b9;
						font-size: 20rpx;
						display: flex;
						justify-content: flex-start;

						image {
							&:nth-child(1) {
								width: 20rpx;
								margin-top: 5rpx;
							}
						}

						text {
							&:nth-child(2) {
								margin-left: 30rpx;
							}
						}
					}
				}
			}

			.delete {
				width: 50rpx;
				margin-top: 29rpx;
				height: 80rpx;
				display: flex;

				justify-content: center;

				image {
					&:nth-child(1) {
						width: 30rpx;
						margin-top: 25rpx;
					}
				}
			}
		}

	}

	.bottom_select {
		position: fixed;
		bottom: 0rpx;
		width: 100%;
		display: flex;
		justify-content: flex-start;
		height: 98rpx;
		border-top: 1rpx solid #F2F2F2;

		.icon {
			width: 120rpx;
			height: 98rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			flex-direction: column;

			&:nth-child(1) {
				margin-left: 35rpx;
			}

			&:nth-child(2) {
				margin-left: 154rpx;
			}

			&:nth-child(3) {
				margin-left: 154rpx;
			}

			.picture {
				width: 100%;
				height: 60rpx;
				display: flex;
				justify-content: center;

				image {
					width: 35rpx;
					margin-top: 15rpx;
				}
			}

			text {
				&:nth-child(2) {
					font-size: 24rpx;
					color: #999999;
				}
			}
		}
	}
</style>
